package org.geekbang.projects.config;

import org.eclipse.microprofile.config.ConfigValue;
import org.eclipse.microprofile.config.spi.ConfigSource;

/**
* 公共的配置信息  
* @author : KangNing Hu
*/
public class CommonConfigValue implements ConfigValue {

	private ConfigSource configSource;

	private String name;

	public CommonConfigValue(ConfigSource  configSource , String name){
		this.configSource = configSource;
		this.name = name;
	}


	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public String getValue() {
		return this.configSource.getValue(this.name);
	}

	@Override
	public String getRawValue() {
		return this.configSource.getValue(this.name);
	}

	@Override
	public String getSourceName() {
		return this.configSource.getName();
	}

	@Override
	public int getSourceOrdinal() {
		return this.configSource.getOrdinal();
	}
}
